import java.util.*;

public class SensorManagerImpl implements SensorManager {

    private Map<String, String> sensorTypeMap;
    private Map<String, Map<Date, Object>> sensorDataMap;

    public static void main(String[] args) {

    }

    public SensorManagerImpl() {
        sensorList = new ArrayList<>();
    }

    public void addSensor(Sensor sensor) {
        sensorTypeMap.put(sensor.getName(), sensor.getClass().getSimpleName());
        sensorDataMap = new HashMap<>();
    }

    public <T> void receiveDate(String sensor, Map<Date, T> recordMap) {
        Map<Date, Object> map = sensorDataMap.get(sensor);
        if (map == null) {
            map = new HashMap<>();
            sensorDataMap.put(sensor, map);
        }
        map.putAll(recordMap);
    }

    @Override
    public void dataReceived(String sensor, Object data) {
        Map<Date, Object> map = sensorDataMap.get(sensor);
        if (map == null) {
            map = new HashMap<>();
            sensorDataMap.put(sensor, map);
        }
        map.put(new Date(), data);
    }
}
